package com.ztools.pc.service.sys;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ztools.common.model.pc.sys.Permission;
import com.ztools.common.model.pc.sys.RolePermission;
import com.ztools.common.util.common.PageUtil;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author:一口香菜
 * @Date: 2023/3/4  15:20
 * @Version 1.0
 */
public interface RolePermissionService extends IService<RolePermission> {

    /**
     * 根据角色ID获取权限
     *
     * @param userId 角色ID
     * @return
     */
    List<Permission> findPerByRoleId(Long userId);

    /**
     * 分页查询
     *
     * @param pageUtil
     * @return
     */
    Page<RolePermission> findList(@RequestBody PageUtil<RolePermission> pageUtil);

    /**
     * 添加权限
     *
     * @param rolePermissionList
     * @return
     */
    boolean addList(List<RolePermission> rolePermissionList);
}
